package service;

import spring.framework.beans.factory.annotation.Autowired;
import spring.framework.beans.factory.annotation.Value;
import spring.framework.stereotype.Component;

import java.util.Random;

/**
 * @author pengzh
 * @desc
 * @class UserService
 * @since 2021-12-03
 */
@Component
public class UserService {

    @Value("${token}")
    private String token;

    @Autowired
    private UserDao userDao;

    public String queryUserInfo() {
        try {
            Thread.sleep(new Random(1).nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return userDao.queryUserName("10001") + "，" + token;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
    }
}
